package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the TA_CAMB database table.
 * 
 */
@Embeddable
public class TaCambPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String coRegi;
	private java.util.Date fecha;

    public TaCambPK() {
    }

	@Column(name="CO_REGI", unique=true, nullable=false, length=2)
	public String getCoRegi() {
		return this.coRegi;
	}
	public void setCoRegi(String coRegi) {
		this.coRegi = coRegi;
	}

    @Temporal( TemporalType.DATE)
	@Column(unique=true, nullable=false)
	public java.util.Date getFecha() {
		return this.fecha;
	}
	public void setFecha(java.util.Date fecha) {
		this.fecha = fecha;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof TaCambPK)) {
			return false;
		}
		TaCambPK castOther = (TaCambPK)other;
		return 
			this.coRegi.equals(castOther.coRegi)
			&& this.fecha.equals(castOther.fecha);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.coRegi.hashCode();
		hash = hash * prime + this.fecha.hashCode();
		
		return hash;
    }
}